package com.sakura.thread.chapter1.test9;

/**
 * Created by apple on 2018/12/11.
 */
public class DeadLockTest {
    private static Object resourceA = new Object();
    private static Object resourceB = new Object();

    public static void main(String[] args) {
        Thread threadA = new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (resourceA) {
                    System.out.println(Thread.currentThread()+"get resourceA");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }

                    System.out.println(Thread.currentThread()+"waiting get resourceB");
                    synchronized (resourceB) {

                    }
                }
            }
        });
    }
}
